/*
 * @Author: your name
 * @Date: 2022-01-24 01:32:28
 * @LastEditTime: 2022-01-29 15:28:45
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \json-serveg:\桌面2\VueStudy\vue-ego\vue-ego\src\api\index.js
 */
import axios from 'axios'
import base from './base'
//node>js 
const qs = require('querystring')


const api = {
    /**
     * 商品列表
     */
    getGoodsList(params){
        return axios.get(base.goodList,{
            params
        })
    },
    getSearchList(params){
        return axios.get(base.searchList,{
            params
        })
    },
    /**
     * 获取分类
     */
    getSearchCategory(params){
        return axios.get(base.searchCategory,{
            params
        })
    },
    /**
     * 添加商品
     */
    getAddGoods(params){
        return axios.get(base.addGoods,{
            params
        })
    },
    /**
     * 删除商品
     */
    getDeleteGoods(params){
        return axios.get(base.deleteGoods,{
            params
        })
    },
    /**
     * 编辑商品
     */
    getEditGoods(params){
        return axios.get(base.editGoods,{
            params
        })
    },
    /**
     * 登录
     */
    getLogin(params){
        return axios.post(base.login,qs.stringify(params)
            
            )
    },
    /**
     * 获取规格参数
     */
    getParams(params){
        return axios.get(base.params,{
            params
        })
    },
    /**
     * 获取规格配置
     */
    getInsertItemParam(params){
        return axios.get(base.insertItemParam,{
            params
        })
    },
    /**
       * 商品列表---获取类目规格配置
       * cid
       */
     categoryData(params){
        return axios.get(base.categoryData,{params})
    },
     /**
    * 统计数据
    */
      getStatistical() {
        return axios.get(base.statistical)
    },
    /**
     * 销量对比
     */
    getSellTotal() {
        return axios.get(base.sellTotal)
    },

}

export default api